import axios from 'axios'
import cfg from '../cfg/cfg'

// axios.defaults.withCredentials=true;
axios.defaults.headers['Content-Type'] = "application/x-www-form-urlencoded";
// axios.defaults.headers['Access-Control-Allow-Credentials'] = "true";
// axios.defaults.headers['Access-Control-Allow-Origin'] = "*";
// axios.defaults.headers['Access-Control-Allow-Headers'] = "X-Requested-With";
// axios.defaults.headers['Access-Control-Allow-Methods'] = "PUT,POST,GET,DELETE,OPTIONS";

export async function sys_info() {
  return axios({
    method: "get",
    url: cfg.ApiUrl + "sys/info"
  })
}

export async function verifyCode_verifyCode() {
  return axios({
    method: "get",
    url: cfg.ApiUrl + "verifyCode/verifyCode"
  })
}

export async function verifyCode_is(verifyCode,verifyCodeS) {
  console.log(verifyCodeS);
  return axios({
    method: "get",
    url: cfg.ApiUrl + "verifyCode/is?verifyCode=" + verifyCode + "&verifyCodeS=" + verifyCodeS
  })
}

export default {
  sys_info,
  verifyCode_verifyCode,
  verifyCode_is
}
